package com.whu.helpluojia.controller;


import com.whu.helpluojia.common.BaseContext;
import com.whu.helpluojia.common.R;
import com.whu.helpluojia.domain.MyPublish;
import com.whu.helpluojia.service.BagManService;
import com.whu.helpluojia.service.MyDetailService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/mydetail")
public class MyDetailController {

    @Autowired
    MyDetailService myDetailService;

    @GetMapping
    public List<MyPublish> getMyPublishments(){

        Long userId=BaseContext.getCurrentId();

        List<MyPublish> myPublishes=myDetailService.getMypublishments(userId);

        return myPublishes;

    }
}
